package
{
	import flash.display.Sprite;
	import flash.utils.Dictionary;
	
	public class dictionaryTest extends Sprite
	{
		public function dictionaryTest()
		{
			var dict:Dictionary = new Dictionary();
			var arr:Array = new Array(1,2,3);
				arr[10] = 10;
//			arr.indexOf= function() {return 44}
				arr.push(11);
			for (var item in arr)
			{
				trace(item+":"+arr[item]);
			}
			for (var i:int=0;i<arr.length;i++)
			{
				trace("arr["+i+"]:"+arr[i]);
			}
			trace("indexOf:"+arr.indexOf(2));
			 var obj:Object = new Object();
			 var obj2:Object = new Object();
			 var key:Object = new Object();
			 key.toString = function():String { return "keye" }
//			 key = "sffg";
			  key.valueOf =function():Object {return "lhj"}
//			  key.hasOwnProperty = function(){return true}
			  trace(key.valueOf());
			  trace(key.toString());
			 dict[key] = "Letters";
			 obj["key"] = "Letters";
			 obj2[key] = "letobj2";
			 trace("obj2[key]"+obj2[key.toString]);
			 arr[key] ="shuzu";
			 dict[key] == "Letters"; // true
			 trace("dict[key]"+dict[key]);
			 obj["key"] == "Letters"; // true 
			 trace("obj[key]"+obj[key]);
			 obj[key] == "Letters"; // true because key == "key" is true because key.toString == "key"
			 dict["key"] == "Letters"; // false because "key" === key is false
			 delete dict[key]; //removes the key
			 arr[1] = null;
			delete arr[1];
			arr.push(43);
			trace(Math.round(0.5),Math.round(0.49));
		}

	}
}